package com.spring.demo1;

import java.lang.annotation.ElementType;

/**
 * @author vhans
 */
@Ann(value = "我用在了类上", elementType = ElementType.TYPE)
public class AnnTest {
    @Ann(value = "我用在了字段上", elementType = ElementType.FIELD)
    private String name;

    @Ann(value = "我用在了构造方法上", elementType = ElementType.CONSTRUCTOR)
    public AnnTest(@Ann(value = "我用在了方法参数上", elementType = ElementType.PARAMETER) String name) {
        this.name = name;
    }

    @Ann(value = "我用在了普通方法上", elementType = ElementType.METHOD)
    public void fun(@Ann(value = "我用在了方法参数a上", elementType = ElementType.PARAMETER) String a,
                    @Ann(value = "我用在了方法参数b上", elementType = ElementType.PARAMETER) int b) {
        @Ann(value = "我用在了本地变量上", elementType = ElementType.LOCAL_VARIABLE)
        String name;
    }
}
